<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('userName')->unique()->comment('用户名');
            $table->string('nickName')->comment('昵称')->nullable();
            $table->string('email')->unique()->comment('邮箱');
            $table->string('tel')->unique()->comment('联系方式')->nullable();
            $table->integer('age')->nullable()->default(0)->comment('年龄');
            $table->string('signature')->nullable()->default('这个人很懒，什么都没有留下')->comment('签名');
            $table->integer('level')->default(1)->comment('等级');
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->rememberToken()->nullable();
            $table->timestamps();

            $table->engine = 'InnoDB';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
